#ifndef __MESH_3D_HPP__
#define __MESH_3D_HPP__

#include <GL/glut.h>
#include <string>
#include "../Mathematics/MVector3D.hpp"
#include "../Mathematics/MVector2D.hpp"
#include "IndexedBuffer.hpp"

class IndexBuffer;
//class IndexedBuffer;

typedef enum buffTypes{
	POSITION_OBJECT,
	NORMAL_OBJECT,
	UV_OBJECT,

	BUFFER_TYPES_NUM

} BUFFER_TYPE;

typedef enum xyzCoords{
	X_AXIS,
	Y_AXIS,
	Z_AXIS

} COORDS_AXIS;

class Mesh3D //: public ReferenceCounter
{
public:
	Mesh3D();
	Mesh3D(std::string fileName);
	Mesh3D(char* pDataBuffer, int iBufferSize);
	~Mesh3D();

	void  render();
	void  getCollisionObj();
	void  rotateZ(float fRot);

	float  getMaximum(COORDS_AXIS axis);
	float  getMinimum(COORDS_AXIS axis);
	float& getRotationZ();

private:
	bool  loadGMF(std::string fileName);
	bool  loadGMF(char* pDataBuffer, int iBufferSize);

	IndexBuffer* m_pIdxBuffer;

	IndexedBuffer<float>* m_pVerticesBuffer;
	IndexedBuffer<float>* m_pNormalsBuffer;
	IndexedBuffer<float>* m_pTexCoordsBuffer;

	GLuint m_bufferNames[BUFFER_TYPES_NUM];
	int    m_iDrawVertices;
	float  m_fAngleZ;
};

#endif //__MESH_3D_HPP__

//EOF
